/**
 * SVG text element
 * @class SvgText
 * @extends SvgElement
 * @constructor
 * @param {String} t Text value to render.
 * @param {SVGElement} Dom svg DOM element of the parent container
 * @param {SvgCanvas} The svg stage/canvas
 */
var SvgText = {
    /**
     * Constructor
     * @private
     */
    init: function(t, parent, canvas) {        
        this._super("text", parent, canvas);
        this.dom.appendChild(document.createTextNode(t));
    },
    /**
     * Add a new tspan element inside this text element
     * @method tspan 
     * @param {Object} a attributes
     * @param {String} t The text to render
     * @return {SvgElement} a tspan element
     */
    tspan: function(a, t) {
        var tspan = new SvgElement("tspan", this.dom, this.canvas).attr(a);
        tspan.dom.appendChild(document.createTextNode(t));
        return tspan; 
    }
};
SvgText = SvgElement.extend(SvgText);